package edu.whu.xterm.util;

import java.net.URI;
import java.net.URISyntaxException;

public class URIUtils {

	public static URI createURI(final String scheme, final String host, int port, final String path,
			final String query, final String fragment) {
		try {
			return org.apache.http.client.utils.URIUtils.createURI(scheme, host, port, path, query, fragment);
		} catch (URISyntaxException e) {
			throw new IllegalArgumentException(e.getMessage());
		}
	}

	public static URI createURI(final String host, final String path, final String query) {
		return createURI("Http", host, -1, path, query, null);
	}
}
